#define _DOUBLE_LIST_VER3_

#define  DListRetOk 0
#define  DListRetFail -1
#define  DLIST_ENTRY_EXISTED 2
#define  DLIST_ENTRY_NOT_EXIST 3

struct d_node;
typedef struct d_node _DNode;
typedef struct d_node *_DList;
typedef int DListRet;
typedef int (* DListCmpFunc)(void *data1, void *data2);
typedef int (*DListPrintFunc)(void *data);
typedef DListRet (* DListVisitFunc)(void *arg, void *data);
extern _DNode *create_node(void *data);
extern DListRet destroy_node(_DNode *node);
extern _DList create_list();
extern DListRet destroy_list();
extern DListRet insert_to_list(_DList head, _DNode *node);
extern DListRet delete_node(_DList head, DListCmpFunc cmp, void *key);

extern DListRet for_each_node(_DList head, void *(* func)(void *));
extern DListRet dlist_foreach(_DList thiz, DListVisitFunc visit, void *arg);

